<?php

/**
* @file v1.php
* @name 安稳钱包接口
* @author 
* @version V1
* @date 2018-03-15
 */
$app->group(['prefix' => 'v1', 'namespace' => 'V1', 'middleware' => ['sign', 'api_cros', 'analysis']], function ($app) {


    /**
     *   Auth API  (认证)
     */
    $app->group(['prefix' => 'auth'], function ($app) {
        // 正常登陆
        $app->post('login', ['middleware' => ['validate:login'], 'uses' => 'AuthController@login']);
        // 快速登陆
        $app->post('quicklogin', ['middleware' => ['validate:quicklogin'], 'uses' => 'AuthController@quickLogin']);
        // 用户退出
        $app->post('logout', ['middleware' => ['auth'], 'uses' => 'AuthController@logout']);
    });


    /**
     *  Users API  (用户)
     */
    $app->group(['prefix' => 'users'], function ($app) {
        //***************** 测试demo********************
        $app->get('test', ['uses' => 'TestController@test']);

        $app->post('jiemi', ['uses' => 'TestController@jiemi']);


    });


    /**
     *  Sms API (短信)
     */
    $app->group(['prefix' => 'sms'], function ($app) {
        //注册短信验证码
        $app->post('getCode', ['uses' => 'SmsController@SendCode']);
        // 验证码校验
        $app->post('checkCode', ['uses' => 'SmsController@checkCode']);
        //获取用户手机号
        $app->post('getUser', ['uses' => 'SmsController@getUser']);


    });


    /**
     *  Quick API  (快速登录)
     */
    $app->group(['prefix' => 'quick'], function ($app) {
        //快捷登录
        $app->post('login', ['middleware' => ['validate:Quicklogin'], 'uses' => 'QuickController@QuickLogin']);


    });

    /**
     *  Login API  (登录)
     */
    $app->group(['prefix' => 'login'], function ($app) {
        //快捷登录
        $app->post('login', ['uses' => 'LoginController@login']);

    });




    /**
     *   Product API (产品)
     */
    $app->group(['prefix' => 'product'], function ($app) {
        //产品列表
        $app->post('getProduct', ['uses' => 'ProductController@getProduct']);
        //申请点击数
        $app->post('apply', ['middleware' => 'api_token','uses' => 'ProductController@apply']);
        //详请点击数
        $app->post('detail', ['middleware' => 'api_token','uses' => 'ProductController@detail']);
        //筛选接口
        $app->post('screening', ['uses' => 'ProductController@Screening']);
        //查看用户收藏产品列表
        $app->post('getlist', ['middleware' => 'api_token','uses' => 'ProductController@getlist']);
        //获取链接
        $app->post('getUrl', ['uses' => 'ProductController@getUrl']);
        //贷友推荐
        $app->post('getRecommand', ['uses' => 'ProductController@getRecommand']);
        //贷友推荐
        $app->post('getVip', ['uses' => 'ProductController@getVip']);
        //统计
        $app->get('product', ['uses' => 'ProductController@tongji']);
        //热门产品
        $app->get('hot', ['uses' => 'ProductController@hot']);
        //新品
        $app->get('new', ['uses' => 'ProductController@new']);
        //排行榜
        $app->get('rank', ['uses' => 'ProductController@rank']);


    });








    //loading页轮播图
    $app->group(['prefix' => 'content'], function ($app) {
        //
        $app->post('getContent', ['uses' => 'LunBoController@getContent']);

        //轮播手机号
        $app->post('list', ['uses' => 'LunBoController@list']);

    });

});

